pkgname=pm-qa
pkgver=git
pkgrel=1
arch=('i386' 'x86_64')
url="https://git.linaro.org/power/pm-qa.git"
license=('GPL')
makedepends_debian_11=(libx11-dev libgl1-mesa-dev libjpeg-dev libpng-dev libpng16-16 pkg-config sudo)
source=('https://git.linaro.org/power/pm-qa.git' https://github.com/glmark2/glmark2.git)
sha256sums=('SKIP' 'SKIP')

build()
{
	cd ${srcdir}/pm-qa
	make -C cpuidle cpuidle_killer
	cd utils
	make

	cd ${srcdir}/glmark2
	benchmark_path="${pkgdir}/lkp/benchmarks/${pkgname}"
	mkdir -p $benchmark_path/glmark2
	[ "$DISTRO" = "centos" -o "$DISTRO" = "aliyun" ] && sed -i 's/-std=c++14/-std=c++1y/' wscript
	./waf configure --prefix=$benchmark_path/glmark2 --with-flavors=x11-gl || return
	./waf || return
	./waf install || return
}

package() {
	benchmark_path="${pkgdir}/lkp/benchmarks/${pkgname}"
	cp -af "${srcdir}/${pkgname}/"* $benchmark_path
}
